home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / zendisk1.zip / LST10-8.ASM < prev    next >
Assembly Source File  |  1990-02-15  |  573b  |  27 lines

  1. ;
  2. ; *** Listing 10-8 ***
  3. ;
  4. ; Initializes a 1000-word array using a single
  5. ; repeated STOSW.
  6. ;
  7.     jmp    Skip
  8. ;
  9. ARRAY_LENGTH    equ    1000
  10. WordArray    dw    ARRAY_LENGTH dup (?)
  11. ;
  12. Skip:
  13.     call    ZTimerOn
  14.     mov    di,seg WordArray
  15.     mov    es,di
  16.     mov    di,offset WordArray
  17.             ;point ES:DI to the array to
  18.             ; fill, since STOSW must
  19.             ; use that segment:offset combo
  20.             ; as a memory pointer
  21.     sub    ax,ax    ;we'll fill with the value zero
  22.     mov    cx,ARRAY_LENGTH ;# of words to fill
  23.     cld        ;make STOSW add 2 to DI after each
  24.             ; execution
  25.     rep    stosw    ;fill the array
  26.     call    ZTimerOff
  27.